package com.linln.modules.member.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.linln.modules.member.domain.MemberInfo;

import lombok.Data;

/**
 * @author hct
 * @date 2019/10/11
 */
@Data
@Entity
@Table(name="sys_notice")
@EntityListeners(AuditingEntityListener.class)
public class Notice implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;
    // 类型
    private Integer type;
    
 // 类型
    private Long typeId;
       
    // 消息内容
    private String content;
    //0代表未读 1代表已读
    private Integer isread;
    // 创建时间
    @CreatedDate
    private Date createDate;
    // 消息发出人
    //private Long memberid;
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="memberid")
    private MemberInfo member;
    // 更新时间
    @LastModifiedDate
    private Date updateDate;
    private String area;
}